package com.whmall.service.crm.provider;

import com.whmall.service.crm.api.SupplierAccountApi;
import com.whmall.service.crm.entity.dto.company.SupplierAccountKeyFieldRspDTO;
import com.whmall.service.crm.entity.dto.company.SupplierAccountQueryReqDTO;
import com.whmall.service.crm.module.company.service.SupplierAccountService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;
import java.util.Map;

@RequiredArgsConstructor
@DubboService(interfaceClass = SupplierAccountApi.class)
public class SupplierAccountProvider implements SupplierAccountApi {

    private final SupplierAccountService supplierAccountService;

    @Override
    public SupplierAccountKeyFieldRspDTO queryById(long id) {
        return supplierAccountService.queryById(id);
    }

    @Override
    public Map<Long, SupplierAccountKeyFieldRspDTO> queryByIds(List<Long> ids) {
        return supplierAccountService.queryByIds(ids);
    }

    @Override
    public Map<String, List<SupplierAccountKeyFieldRspDTO>> queryByAccounts(List<String> accounts) {
        return supplierAccountService.queryByAccounts(accounts);
    }

    @Override
    public Map<String, List<SupplierAccountKeyFieldRspDTO>> queryByAccountName(List<String> accountNames) {
        return supplierAccountService.queryByAccountNames(accountNames);
    }

    @Override
    public Map<Long, List<SupplierAccountKeyFieldRspDTO>> queryByCompanyIds(List<Long> companyIds) {
        return supplierAccountService.queryByCompanyIds(companyIds);
    }

    @Override
    public List<SupplierAccountKeyFieldRspDTO> queryBy(SupplierAccountQueryReqDTO queryReqDTO) {
        return supplierAccountService.queryBy(queryReqDTO);
    }

    @Override
    public SupplierAccountKeyFieldRspDTO getDefaultAccount(Long companyId) {
        return supplierAccountService.getDefaultAccount(companyId);
    }
}
